﻿
@{
    Layout = null;
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>产品零件及工序</title>
    <link rel="stylesheet" href="~/Content/bootstrap.min.css" />
    <link rel="stylesheet" href="~/Content/bootstrap-table.css" />
    <link href="~/Content/style.css" rel="stylesheet" type="text/css" />

</head>

<body>
    <div class="pro_r">
        <div class="pro_top table1">
            <h3><span>零件名称</span></h3>
            <table class="part_table"></table>
            <p><a id="add">添加材料</a><a id="del">修改材料</a><a>删除材料</a></p>
        </div>
        <div class="pro_bottom table1">
            <h3><span>工序名称</span></h3>
            <table class="gx_table"></table>
            <p><a id="add_1">添加工艺</a><a id="del_1">修改工艺</a><a>删除工艺</a></p>
        </div>
    </div>
    <div id="box_add4">
        <h2>添加材料<span>×</span></h2>
        <ul class="mc">
            <li style="width:170px;"><p>材料名称</p><input style="width:120px;" type="text" /><a class="jb">>></a></li>
            <li><p>规格</p><input type="text" /></li>
            <li><p>单价(元/kg)</p><input type="text" /></li>
            <li><p>下单数量</p><input type="text" /></li>
            <li><p>单件可回收废料(kg)</p><input type="text" /></li>
        </ul>

        <div class="xh">
            <em>材料型号</em>
            <ul><li class="li_1"><i>δ 板材</i></li><li><p>厚(mm)</p><input type="text" /></li><li><p>长(mm)</p><input type="text" /></li><li><p>款(mm)</p><input type="text" /></li></ul>
            <ul><li class="li_1"><i>Φ 棒料</i></li><li><p>直径(mm)</p><input type="text" /></li><li><p>长(mm)</p><input type="text" /></li></ul>
            <ul><li class="li_1"><i>Φ 圆管料</i></li><li><p>外径(mm)</p><input type="text" /></li><li><p>内径(mm)</p><input type="text" /></li><li><p>长度(mm)</p><input type="text" /></li></ul>
            <ul><li class="li_1"><i>□ 方管料</i></li><li><p>长(mm)</p><input type="text" /></li><li><p>宽(mm)</p><input type="text" /></li><li><p>壁厚(mm)</p><input type="text" /></li></li><li><p>长度(mm)</p><input type="text" /></li></ul>
            <h3>特殊钢（角钢、槽钢、H型钢、六角、铝型材等）</h3>
            <ul class="ts">
                <li class="li_1"><i>材料规格</i></li>
                <li><input style="width:316px;" type="text" /></li>
                <li><span>长度</span><input type="text" /><span>毫米</span><span>单位</span><input type="text" /><span>元/kg</span></li>
                <li><span>单件表面积分</span><input type="text" /><span>平方米</span></li>
            </ul>
            <h3>毛坯或不规则材料</h3>
            <ul class="ts" style="height:30px;">
                <li class="li_1"><i>规格型号</i></li>
                <li><input type="text" /></li>
                <li><span>单重</span><input type="text" /><span>kg</span><span>单件表面积分</span><input type="text" /><span>平方米</span></li>
            </ul>
        </div>
        <p class="bt"><input type="submit" class="jb" value="保存" /><input class="jb" type="button" value="返回" /></p>
    </div>
    <div id="box_sel">
        <h2>选择材料<span>×</span></h2>
        <p><input class="inp" type="text" /><input class="sub jb" type="submit" value="查找" /><a class="jb">确定</a><a class="jb">取消</a></p>
        <div class="table2">
            <table cellspacing="1">
                <tr><th>材料名称</th><th>规格</th><th>单位(元/kg)</th><th>比重</th></tr>
                <tr><td>钢</td><td>002</td><td>20</td><td>10</td></tr>
                <tr><td>钢</td><td>002</td><td>20</td><td>10</td></tr>
                <tr><td>钢</td><td>002</td><td>20</td><td>10</td></tr>
                <tr><td>钢</td><td>002</td><td>20</td><td>10</td></tr>
                <tr><td>钢</td><td>002</td><td>20</td><td>10</td></tr>
            </table>
        </div>
    </div>
    <div id="box_sel_1">
        <h2>工序名查询<span>×</span></h2>
        <p><input class="inp" type="text" /><input class="sub jb" type="submit" value="查找" /><a class="jb">确定</a><a class="jb">取消</a></p>
        <div class="table2">
            <table cellspacing="1">
                <tr><th>工序名称</th><th>工艺术语</th></tr>
                <tr><td>车</td><td>车全部</td></tr>
                <tr><td>车</td><td>车全部</td></tr>
                <tr><td>车</td><td>车全部</td></tr>
                <tr><td>车</td><td>车全部</td></tr>
                <tr><td>车</td><td>车全部</td></tr>
            </table>
        </div>
    </div>
    <div id="box_add5">
        <h2>工序编辑<span>×</span></h2>
        <div><span>零件编号：</span><input type="text" /></div>
        <div><span>零件名称：</span><input type="text" /></div>
        <div><span>工序编号：</span><input type="text" /></div>
        <div><span>工序名称：</span><select><option value=""></option><option value="工序1">工序1</option><option value="工序2">工序2</option></select></div>
        <div><span>工序内容：</span><input type="text" style="width:377px;" /><a class="jb">>></a></div>
        <div><span>准备工时：</span><input type="text" /></div>
        <div><span>单件工时：</span><input type="text" /></div>
        <div><span>热重工时：</span><input type="text" /></div>
        <div><span>操作员工：</span><input type="text" /></div>
        <div class="clear"></div>
        <p><input type="submit" class="jb" value="保存" /><input class="jb" type="button" value="返回" /></p>
    </div>
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/bootstrap.min.js"></script>
    <script src="~/Scripts/bootstrap-table.js"></script>
    <script src="~/Scripts/locale/bootstrap-table-zh-CN.js"></script>
    <script src="~/Scripts/uilts.js"></script>
    <script>
        $(function(){
            $('.table1 tr:even').find('td').css("background","#e9f3ff");
            $('.table1 tr').click(function(){
                $('.table1 tr').removeClass("act");
                $(this).addClass("act");
            });
        });
    </script>
    <script>
        $(function(){
            fn($('#add'),$('#box_add4'));
            fn($('#del'),$('#box_add4'));
            fn($('#add_1'),$('#box_add5'));
            fn($('#del_1'),$('#box_add5'));

            function fn(oA,oB){
                oA.click(function(){
                    oB.css("display","block");
                });
                oB.find('p input').eq(1).click(function(){
                    oB.css("display","none");
                });
                oB.find('h2 span').click(function(){
                    oB.css("display","none");
                });
            }

            $('#box_add4 .mc a').click(function(){
                $('#box_sel').css("display","block");
            });
            $('#box_sel').find('p a').click(function(){
                $('#box_sel').css("display","none");
            });
            $('#box_sel').find('h2 span').click(function(){
                $('#box_sel').css("display","none");
            });

            $('#box_add5 a').click(function(){
                $('#box_sel_1').css("display","block");
            });
            $('#box_sel_1').find('p a').click(function(){
                $('#box_sel_1').css("display","none");
            });
            $('#box_sel_1').find('h2 span').click(function(){
                $('#box_sel_1').css("display","none");
            });
        });
    </script>

    <script>
        var productid = GetQueryString("productid");
        var $table_part = $('table.part_table');
        function InitPartTable(pageIndex, pageSize) {
            if (typeof pageIndex == "object") {
                pageIndex = undefined;
            }
            $table_part.bootstrapTable('destroy');
            $table_part.bootstrapTable({
                method: "post",  //使用get请求到服务器获取数据
                url: "/product/ProductPartlistdata", //获取数据的Servlet地址
                striped: true,  //表格显示条纹
                pagination: true, //启动分页
                pageSize: pageSize == null ? 10 : pageSize,  //每页显示的记录数
                pageNumber: pageIndex == null ? 1 : pageIndex, //当前第几页
                pageList: [10, 20, 50, 100, 250],  //记录数可选列表
                search: false,  //是否启用查询
                showColumns: false,  //显示下拉框勾选要显示的列
                showRefresh: false,  //显示刷新按钮
                sidePagination: "server", //表示服务端请求
                sortName: "ID",
                //设置为undefined可以获取pageNumber，pageSize，searchText，sortName，sortOrder
                //设置为limit可以获取limit, offset, search, sort, order
                queryParamsType: "undefined",
                queryParams: function queryParams(params) {   //设置查询参数
                    var param = {
                        PageIndex: params.pageNumber,
                        PageSize: params.pageSize,
                        sorter: params.sortName + " " + params.sortOrder,
                        productid: productid
                    };
                    return param;
                },
                columns: [
                    {
                        field: 'sno',
                        title: "零件编号",
                        align: 'center',
                        valign: 'middle'
                    },
                    {
                        field: 'name',
                        title: '零件名称',
                        align: 'center',
                        valign: 'middle'
                    },
                    {
                        field: 'qty',
                        title: '零件个数',
                        align: 'center',
                        valign: 'middle'
                    },
                    {
                        field: 'weight',
                        align: 'center',
                        title: '净重',
                        valign: 'middle'
                    }
                ],
                onLoadSuccess: function () {
                    $('table tr:even').find('td').css("background", "#e9f3ff");
                    $('table tr').click(function () {
                        uncheckAll($table_part);
                        $('table tr').removeClass("act");
                        $(this).addClass("act");
                        $table_part.bootstrapTable('check', $(this).attr("data-index"));
                    });
                }
            });
        }
        InitPartTable();

    </script>
</body>
</html>

